Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move from create react app to vite #1900

Merged
merged 11 commits into from
Dec 20, 2024
Merged

Move from create react app to vite #1900

merged 11 commits into from
Dec 20, 2024

Conversation

Eddasol
Copy link
Contributor

@Eddasol Eddasol commented Dec 18, 2024

This involves:

  • Install vite and uninstall react-app
  • Adding of vite scripts in package.json
  • Updating index.html
    • Moving to root
    • Removing %PUBLIC_URL%
  • Add vite.config.ts
    • Aliases to allow absolute imports
    • esnext target build to solve "Top-level-await"-error
    • Setting 3001 as port
  • Replace react app env with vite env
  • Update tsconfig for Vite
  • Rename environment variables to VITE prefix

Based on https://dev.to/henriquejensen/migrating-from-create-react-app-to-vite-a-quick-and-easy-guide-5e72

Ready for review checklist:

  • A self-review has been performed
  • All commits run individually
  • Temporary changes have been removed, like console.log, TODO, etc.
  • The PR has been tested locally
  • A test have been written
    • This change doesn't need a new test
  • Relevant issues are linked
  • Remaining work is documented in issues
    • There is no remaining work from this PR that require new issues
  • The changes does not introduce dead code as unused imports, functions etc.

@Eddasol Eddasol self-assigned this Dec 18, 2024
@Eddasol Eddasol added the improvement Improvement to existing functionality label Dec 18, 2024
@Eddasol Eddasol linked an issue Dec 18, 2024 that may be closed by this pull request
@Eddasol Eddasol added the frontend Frontend related functionality label Dec 18, 2024
@Eddasol Eddasol force-pushed the vite branch 8 times, most recently from ec98d04 to ea2f20e Compare December 19, 2024 11:31
@Eddasol Eddasol marked this pull request as ready for review December 19, 2024 11:49
@Eddasol
Copy link
Contributor Author

Eddasol commented Dec 19, 2024

Most of the linting is currently turned off as the the current implementation of frontend isn't complying with those rules. Fixing this will be solved as separate issue #1908

@Eddasol Eddasol force-pushed the vite branch 6 times, most recently from 3db49b5 to b17ebce Compare December 20, 2024 07:25
This involves:
* Install vite and uninstall react-app
* Adding of vite scripts in package.json
* Updating index.html
  * Move to root
  * Removing %PUBLIC_URL%
* Add vite.config.ts
  * Aliases to solve absolute imports
  * esnext target build to solve "Top-level-await" error
  * Setting 3001 as port
* Replace react app env with vite env
* Update tsconfig for Vite
* Rename environment variables to VITE prefix
Copy link
Contributor

@andchiind andchiind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Eddasol Eddasol merged commit 803256e into equinor:main Dec 20, 2024
13 checks passed
@Eddasol Eddasol deleted the vite branch December 20, 2024 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Frontend related functionality improvement Improvement to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Vite instead of create-react-app
2 participants